package cn.zstu.seckill.dao;

import cn.zstu.seckill.bo.GoodsBo;
import cn.zstu.seckill.entity.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//@Mapper
public interface GoodsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Goods record);

    int insertSelective(Goods record);

    Goods selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKeyWithBLOBs(Goods record);

    int updateByPrimaryKey(Goods record);

//    @Select("select sg.seckil_price,sg.stock_count,sg.start_date,sg.end_date,goods.id,goods.goods_name,goods.goods_title,goods.goods_img,goods.goods_price,goods.goods_stock,goods.create_date,goods.update_date,goods.goods_detail from goods left join seckill_goods sg on sg.goods_id = goods.id")
    List<GoodsBo> selectAllGoods();

    GoodsBo getseckillGoodsBoByGoodsId(long goodsId);

    int updateStock(long goodsId);
}